package com.subsequent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subsequent.pojo.Assess;
import com.subsequent.service.AssessService;
import com.subsequent.mapper.AssessMapper;
import com.subsequent.utils.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 申其卓
* @description 针对表【assess】的数据库操作Service实现
* @createDate 2025-05-08 11:03:41
*/
@Service
public class AssessServiceImpl extends ServiceImpl<AssessMapper, Assess>
    implements AssessService{
    @Resource
    private AssessMapper assessMapper;
    @Override
    public Result selectAssessById(Integer userId) {
        QueryWrapper<Assess>queryWrapper=new QueryWrapper<>();
        queryWrapper.lambda().eq(Assess::getHospitalId,userId);
        List<Assess> assesses = assessMapper.selectList(queryWrapper);
        if(assesses!=null){
            return Result.success(assesses);
        }
        return Result.error("查询失败");
    }
}




